home *** CD-ROM | disk | FTP | other *** search
/ Geek Games #12 / GEGA012.iso / Jogos de Azar / 46.swf / scripts / frame_4 / DoAction.as < prev   
Text File  |  2006-01-17  |  26KB  |  1,049 lines

  1. function addConveyor()
  2. {
  3.    if(conv.conveyorON)
  4.    {
  5.       conv.aConveyor.push(arguments);
  6.    }
  7.    else
  8.    {
  9.       conv.bConveyor.push(arguments);
  10.    }
  11. }
  12. function MessageToChat(speaker, message)
  13. {
  14.    chatText += "\r<b>" + speaker + ":</b> " + message;
  15.    McMaxscroll.gotoAndPlay(2);
  16. }
  17. function GamePrams()
  18. {
  19.    this.curBet = 5;
  20.    this.userBalance = 999;
  21.    this.crBalance();
  22.    this.bet = 0;
  23.    this.prize_table = {};
  24.    this.prize_table[10] = {};
  25.    this.prize_table[10][10] = 10000;
  26.    this.prize_table[10][9] = 5000;
  27.    this.prize_table[10][8] = 1000;
  28.    this.prize_table[10][7] = 125;
  29.    this.prize_table[10][6] = 24;
  30.    this.prize_table[10][5] = 5;
  31.    this.prize_table[9] = {};
  32.    this.prize_table[9][9] = 10000;
  33.    this.prize_table[9][8] = 5000;
  34.    this.prize_table[9][7] = 500;
  35.    this.prize_table[9][6] = 50;
  36.    this.prize_table[9][5] = 5;
  37.    this.prize_table[8] = {};
  38.    this.prize_table[8][8] = 10000;
  39.    this.prize_table[8][7] = 2500;
  40.    this.prize_table[8][6] = 125;
  41.    this.prize_table[8][5] = 10;
  42.    this.prize_table[7] = {};
  43.    this.prize_table[7][7] = 10000;
  44.    this.prize_table[7][6] = 250;
  45.    this.prize_table[7][5] = 25;
  46.    this.prize_table[7][4] = 5;
  47.    this.prize_table[6] = {};
  48.    this.prize_table[6][6] = 2500;
  49.    this.prize_table[6][5] = 50;
  50.    this.prize_table[6][4] = 5;
  51.    this.prize_table[6][3] = 2;
  52.    this.prize_table[5] = {};
  53.    this.prize_table[5][5] = 250;
  54.    this.prize_table[5][4] = 25;
  55.    this.prize_table[5][3] = 5;
  56.    this.prize_table[4] = {};
  57.    this.prize_table[4][4] = 50;
  58.    this.prize_table[4][3] = 5;
  59.    this.prize_table[4][2] = 2;
  60.    this.prize_table[3] = {};
  61.    this.prize_table[3][3] = 25;
  62.    this.prize_table[3][2] = 2;
  63.    this.numbers = {};
  64.    this.max_length = 10;
  65.    this.numbers_length = 0;
  66.    this.ideal_numbers = [];
  67.    var i = 0;
  68.    while(i < 80)
  69.    {
  70.       this.ideal_numbers[i] = i + 1;
  71.       i++;
  72.    }
  73.    this.setButtons();
  74. }
  75. function test_server()
  76. {
  77.    if(_level5)
  78.    {
  79.       if(_level5.serverWork)
  80.       {
  81.          _visible = 0;
  82.          _level5.XML_POST_LINE();
  83.       }
  84.       else
  85.       {
  86.          _visible = 0;
  87.          _root.conv.put(arguments.callee,1000);
  88.       }
  89.    }
  90.    else
  91.    {
  92.       delete arguments.callee;
  93.    }
  94. }
  95. if(this == _level0 && include_Library_Complete != true)
  96. {
  97.    var include_Library_Complete = true;
  98.    var mc = MovieClip.prototype;
  99.    mc.movieTo = function()
  100.    {
  101.       this._x = arguments[0];
  102.       this._y = arguments[1];
  103.    };
  104.    mc.movieBy = function()
  105.    {
  106.       this._x += arguments[0];
  107.       this._y += arguments[1];
  108.    };
  109.    mc.size = function()
  110.    {
  111.       if(arguments[0] != null && arguments[0] != 0)
  112.       {
  113.          this._width = arguments[0];
  114.       }
  115.       if(arguments[0] != null && arguments[0] != 0)
  116.       {
  117.          this._height = arguments[1];
  118.       }
  119.    };
  120.    mc.scale = function()
  121.    {
  122.       _xscale = _yscale = arguments[0];
  123.    };
  124.    mc.scaleTo = function(xscale, yscale)
  125.    {
  126.       if(arguments[0] != null && arguments[0] != 0)
  127.       {
  128.          this._xscale = arguments[0];
  129.       }
  130.       if(arguments[1] != null && arguments[1] != 0)
  131.       {
  132.          this._yscale = arguments[1];
  133.       }
  134.    };
  135.    mc.scaleBy = function()
  136.    {
  137.       this._xscale *= arguments[0];
  138.       this._yscale *= arguments[0];
  139.    };
  140.    mc.rotateBy = function()
  141.    {
  142.       this._rotation += arguments[0];
  143.    };
  144.    mc.hide = function()
  145.    {
  146.       this._visible = 0;
  147.    };
  148.    mc.show = function()
  149.    {
  150.       this._visible = 1;
  151.    };
  152.    mc.visInvert = function()
  153.    {
  154.       this._visible = !this._visible;
  155.    };
  156.    mc.flipV = function()
  157.    {
  158.       this._xscale *= -1;
  159.    };
  160.    mc.flipH = function()
  161.    {
  162.       this._yscale *= -1;
  163.    };
  164.    mc.playOffset = function()
  165.    {
  166.       this.gotoAndPlay(this._currentframe + arguments[0]);
  167.    };
  168.    mc.childs = function()
  169.    {
  170.       var result_childs = new Array();
  171.       for(var v in "this")
  172.       {
  173.          if(typeof this[v] == "movieclip" && this[v]._parent == this)
  174.          {
  175.             result_childs.push(this[v]);
  176.          }
  177.       }
  178.       return result_childs;
  179.    };
  180.    mc.allChilds = function()
  181.    {
  182.       if(_root.allChilds_root_movieclip == null)
  183.       {
  184.          _root.allChilds_root_movieclip = this;
  185.       }
  186.       this.allChilds_tested = true;
  187.       var result_allChilds = new Array();
  188.       for(var v in "this")
  189.       {
  190.          if(typeof this[v] == "movieclip")
  191.          {
  192.             if(this[v].allChilds_tested || this[v]._parent != this)
  193.             {
  194.                continue;
  195.             }
  196.             result_allChilds.push(this[v]);
  197.             result_allChilds = result_allChilds.concat(this[v].allChilds());
  198.          }
  199.       }
  200.       if(_root.allChilds_root_movieclip == this)
  201.       {
  202.          var allChilds_i = 0;
  203.          while(allChilds_i < result_allChilds.length)
  204.          {
  205.             delete result_allChilds[allChilds_i].allChilds_tested;
  206.             allChilds_i++;
  207.          }
  208.          delete _root.allChilds_root_movieclip;
  209.          delete allChilds_tested;
  210.       }
  211.       return result_allChilds;
  212.    };
  213.    mc.copy = function(fromClip, paramArray)
  214.    {
  215.       if(paramArray == null)
  216.       {
  217.          paramArray = new Array("_width","_height","_x","_y","_alpha");
  218.       }
  219.       var rotation_fromClip = fromClip._rotation;
  220.       fromClip._rotation = 0;
  221.       var rotation_thisClip = this._rotation;
  222.       this._rotation = 0;
  223.       var copy_a = 0;
  224.       while(copy_a < paramArray.length)
  225.       {
  226.          this[paramArray[copy_a]] = fromClip[paramArray[copy_a]];
  227.          copy_a++;
  228.       }
  229.       fromClip._rotation = rotation_fromClip;
  230.       this._rotation = rotation_fromClip;
  231.    };
  232.    mc.copyColor = function(fromClip)
  233.    {
  234.       new Color(this).setTransform(new Color(fromClip).getTransform());
  235.    };
  236.    mc.AnimToPlace = function(StartA, FinishA, Steps, CurrStep, XY)
  237.    {
  238.       this[XY] = StartA + (FinishA - StartA) / Steps * CurrStep;
  239.    };
  240.    mc.newSound = function(id, volume, loop)
  241.    {
  242.       this.mySound = new Sound();
  243.       this.mySound.attachSound(id);
  244.       this.mySound.setVolume(volume || 100);
  245.       this.mySound.start(0,loop || 1);
  246.    };
  247.    mc.stopSound = function(id, volume, loop)
  248.    {
  249.       this.mySound.stop();
  250.    };
  251.    mc.localToLocal = function(fromMc)
  252.    {
  253.       fromMc.localToGlobal(arguments[1]);
  254.       this.globalToLocal(arguments[1]);
  255.    };
  256.    mc.align = function(fromClip)
  257.    {
  258.       var bounds_align = this.getBounds(fromClip || this._parent);
  259.       if(arguments[1] != "v")
  260.       {
  261.          this._x -= (bounds_align.xMin + bounds_align.xMax) / 2;
  262.       }
  263.       if(arguments[1] != "h")
  264.       {
  265.          this._y -= (bounds_align.yMin + bounds_align.yMax) / 2;
  266.       }
  267.    };
  268.    mc.alignH = function(fromClip)
  269.    {
  270.       this.align(fromClip || this._parent,"h");
  271.    };
  272.    mc.alignV = function(fromClip)
  273.    {
  274.       this.align(fromClip || this._parent,"v");
  275.    };
  276.    mc.SearchTop = function()
  277.    {
  278.       var SearchTop_tmp = this;
  279.       var SearchTop_tmp_bk;
  280.       while(tmp != _root)
  281.       {
  282.          SearchTop_tmp_bk = SearchTop_tmp;
  283.          SearchTop_tmp = SearchTop_tmp._parent;
  284.       }
  285.       return SearchTop_tmp_bk;
  286.    };
  287.    mc.setParam = function()
  288.    {
  289.       this[arguments[0]] = arguments[1];
  290.    };
  291.    mc.old_attachMovie = mc.attachMovie;
  292.    mc.attachMovie = function(arg1, arg2, arg3)
  293.    {
  294.       this.old_attachMovie(arg1,arg2,arg3);
  295.       return this[arg2];
  296.    };
  297.    mc.old_duplicateMovieClip = mc.duplicateMovieClip;
  298.    mc.duplicateMovieClip = function()
  299.    {
  300.       this.old_duplicateMovieClip(arguments[0],arguments[1]);
  301.       return this._parent[arguments[0]];
  302.    };
  303.    mc.played = true;
  304.    mc.old_play = mc.play;
  305.    mc.play = function()
  306.    {
  307.       this.played = true;
  308.       this.old_play();
  309.    };
  310.    mc.old_gotoAndPlay = mc.gotoAndPlay;
  311.    mc.gotoAndPlay = function()
  312.    {
  313.       this.gotoAndPlayed = true;
  314.       this.old_gotoAndPlay(arguments[0],arguments[1]);
  315.    };
  316.    mc.old_stop = mc.stop;
  317.    mc.stop = function()
  318.    {
  319.       this.played = false;
  320.       this.old_stop();
  321.    };
  322.    mc.old_gotoAndStop = mc.gotoAndStop;
  323.    mc.gotoAndStop = function()
  324.    {
  325.       this.played = false;
  326.       this.old_gotoAndStop(arguments[0],arguments[1]);
  327.    };
  328.    mc.old_prevFrame = mc.prevFrame;
  329.    mc.prevFrame = function()
  330.    {
  331.       this.played = false;
  332.       this.old_prevFrame();
  333.    };
  334.    mc.old_nextFrame = mc.nextFrame;
  335.    mc.nextFrame = function()
  336.    {
  337.       this.played = false;
  338.       this.old_nextFrame();
  339.    };
  340.    mc.pause = function()
  341.    {
  342.       if(this.paused_mc_array != null)
  343.       {
  344.          delete this.pause_flag;
  345.          var pause_i = 0;
  346.          while(pause_i < this.paused_mc_array.length)
  347.          {
  348.             this.paused_mc_array[pause_i].play();
  349.             pause_i++;
  350.          }
  351.          delete this.paused_mc_array;
  352.       }
  353.       else
  354.       {
  355.          var pause_array = this.allChilds();
  356.          pause_array.push(this);
  357.          this.paused_mc_array = new Array();
  358.          var pause_i = 0;
  359.          while(pause_i < pause_array.length)
  360.          {
  361.             if(pause_array[pause_i].played && pause_array[pause_i]._totalframes != 1)
  362.             {
  363.                pause_array[pause_i].stop();
  364.                this.paused_mc_array.push(pause_array[pause_i]);
  365.             }
  366.             pause_i++;
  367.          }
  368.       }
  369.    };
  370.    mc = null;
  371.    delete mc;
  372.    var st = String.prototype;
  373.    st.scrollBy = function(scrOffset)
  374.    {
  375.       var newScroll = this.scroll + scrOffset;
  376.       if(this.maxscroll < newScroll)
  377.       {
  378.          newScroll = this.maxscroll;
  379.       }
  380.       else if(newScroll < 1)
  381.       {
  382.          newScroll = 1;
  383.       }
  384.       this.scroll = newScroll;
  385.    };
  386.    st.OldSplit = st.split;
  387.    st.split = function(str)
  388.    {
  389.       if(1 < str.length)
  390.       {
  391.          return this.OldSplit(str);
  392.       }
  393.       if(str == "" || str == null)
  394.       {
  395.          return this.toCharArray();
  396.       }
  397.       var result = new Array();
  398.       var d = this.length;
  399.       var n = 0;
  400.       var tmpStr = "";
  401.       var ch;
  402.       while(n < d)
  403.       {
  404.          ch = this.substr(++n,1);
  405.          if(ch == str)
  406.          {
  407.             result.push(tmpStr);
  408.             tmpStr = "";
  409.          }
  410.          else
  411.          {
  412.             tmpStr += ch;
  413.          }
  414.       }
  415.       result.push(tmpStr);
  416.       return result;
  417.    };
  418.    st.toCharArray = function()
  419.    {
  420.       var st = this;
  421.       var arr_result = new Array();
  422.       var s = 0;
  423.       while(s < st.length)
  424.       {
  425.          arr_result.push(this.substr(s + 1,1));
  426.          s++;
  427.       }
  428.       return arr_result;
  429.    };
  430.    st.charAt = function(index)
  431.    {
  432.       return this.substr(index + 1,1);
  433.    };
  434.    st = null;
  435.    delete st;
  436.    var xm = XML.prototype;
  437.    xm.attr = xm.firstChild.attributes;
  438.    xm = null;
  439.    delete xm;
  440.    var arr = Array.prototype;
  441.    arr.nSort = function()
  442.    {
  443.       this.sort(function(a, b)
  444.       {
  445.          if(Number(a) < Number(b))
  446.          {
  447.             return -1;
  448.          }
  449.          if(Number(b) < Number(a))
  450.          {
  451.             return 1;
  452.          }
  453.          return 0;
  454.       }
  455.       );
  456.       return this;
  457.    };
  458.    arr.trim = function(searched_array)
  459.    {
  460.       if(searched_array == null)
  461.       {
  462.          searched_array = ["",null];
  463.       }
  464.       var trim_i = 0;
  465.       while(trim_i < this.length)
  466.       {
  467.          if(searched_array.indexOf(this[trim_i]) != -1)
  468.          {
  469.             this.splice(trim_i,1);
  470.             trim_i--;
  471.          }
  472.          trim_i++;
  473.       }
  474.       return this;
  475.    };
  476.    arr.indexOf = function(searched)
  477.    {
  478.       var indexOf_i = 0;
  479.       while(indexOf_i < this.length)
  480.       {
  481.          if(searched == this[indexOf_i])
  482.          {
  483.             return indexOf_i;
  484.          }
  485.          indexOf_i++;
  486.       }
  487.       return -1;
  488.    };
  489.    arr.random = function()
  490.    {
  491.       var random_i = this.length;
  492.       while(0 < random_i)
  493.       {
  494.          this.push(this.splice(Math.floor(Math.random() * random_i),1)[0]);
  495.          random_i--;
  496.       }
  497.       return this;
  498.    };
  499.    arr = null;
  500.    delete arr;
  501.    Object.prototype.toString = function()
  502.    {
  503.       trace("<<------------------------------------");
  504.       for(param in "this")
  505.       {
  506.          trace(param + " = " + this[param] + " (" + typeof this[param] + ")");
  507.       }
  508.       trace("------------------------------------>>");
  509.    };
  510.    Conveyor_Constructor = function()
  511.    {
  512.       this.aConveyor = new Array();
  513.       this.bConveyor = new Array();
  514.       this.conveyorON = true;
  515.       this.bookmark = 0;
  516.       this.shorts = 0;
  517.       this.engine();
  518.    };
  519.    var conv = Conveyor_Constructor.prototype;
  520.    conv.play = function()
  521.    {
  522.       if(this.conveyorON)
  523.       {
  524.          return undefined;
  525.       }
  526.       this.aConveyor = this.aConveyor.concat(this.bConveyor);
  527.       this.bConveyor = new Array();
  528.       this.conveyorON = true;
  529.    };
  530.    conv.stop = function()
  531.    {
  532.       this.conveyorON = false;
  533.    };
  534.    conv.pause = function(pause)
  535.    {
  536.       this.aConveyor = [[function()
  537.       {
  538.       },pause]].concat(this.aConveyor);
  539.    };
  540.    conv.put = function()
  541.    {
  542.       if(this.conveyorON)
  543.       {
  544.          this.aConveyor.push(arguments);
  545.          if(!this.bookmark && 200 + this.shorts < this.aConveyor.length)
  546.          {
  547.             var tmp_arr = this.aConveyor.slice(100 + this.shorts);
  548.             this.aConveyor.splice(100 + this.shorts);
  549.             this.shorts = this.shorts + 1;
  550.             this.put(function()
  551.             {
  552.                _root.conv.aConveyor = arguments[0].concat(_root.conv.aConveyor);
  553.                _root.conv.shorts--;
  554.             }
  555.             ,0,tmp_arr);
  556.          }
  557.       }
  558.       else
  559.       {
  560.          this.bConveyor.push(arguments);
  561.       }
  562.    };
  563.    conv.put_a = function()
  564.    {
  565.       this.aConveyor.push(arguments);
  566.    };
  567.    conv.engine = function()
  568.    {
  569.       if(this.conveyorON == false)
  570.       {
  571.          this.pause(500);
  572.       }
  573.       var cTime;
  574.       if(this.aConveyor.length == 0)
  575.       {
  576.          cTime = 1000;
  577.       }
  578.       else
  579.       {
  580.          var tA1;
  581.          var tA2;
  582.          var tA3;
  583.          var tA4;
  584.          var tA5;
  585.          var tA6;
  586.          var tA7;
  587.          var tA8;
  588.          var tA9;
  589.          var tA10;
  590.          var tA11;
  591.          var tA12;
  592.          var tA13;
  593.          var tA14;
  594.          var tA15;
  595.          var tA16;
  596.          var tA17;
  597.          i = 0;
  598.          while(i < this.aConveyor[0].length)
  599.          {
  600.             set("tA" + (i + 1),this.aConveyor[0][i]);
  601.             i++;
  602.          }
  603.          this.aConveyor.shift();
  604.          if(typeof tA1 != "function")
  605.          {
  606.             if(typeof tA1[tA2] != "function")
  607.             {
  608.                cTime = tA3;
  609.                tA1[tA2] = tA4;
  610.             }
  611.             else
  612.             {
  613.                cTime = tA3;
  614.                tA1[tA2](tA4,tA5,tA6,tA7,tA8,tA9,tA10,tA11,tA12,tA13,tA14,tA15,tA16,tA17);
  615.             }
  616.          }
  617.          else
  618.          {
  619.             cTime = tA2;
  620.             tA1(tA3,tA4,tA5,tA6,tA7,tA8,tA9,tA10,tA11,tA12,tA13,tA14,tA15,tA16);
  621.          }
  622.       }
  623.       if(cTime != 0)
  624.       {
  625.          if(typeof cTime == "string")
  626.          {
  627.             _root.ConvTimer.frame = true;
  628.          }
  629.          else
  630.          {
  631.             _root.ConvTimer.time = getTimer();
  632.             _root.ConvTimer.frame = false;
  633.          }
  634.          _root.ConvTimer.timeOut = Number(cTime);
  635.          _root.ConvTimer.nTime = 0;
  636.       }
  637.       else
  638.       {
  639.          this.engine();
  640.       }
  641.    };
  642.    conv.anim = function(mc_anim, mc_to, params_ob)
  643.    {
  644.       var to_end = params_ob.to_end * 1 || 0;
  645.       var speed = params_ob.speed || 30;
  646.       var acsel = params_ob.acsel * 1 || 1;
  647.       var scale = params_ob.scale;
  648.       this.put(mc_anim,"swapDepths","1",_root.anim_depth);
  649.       this.put(_root,"newSound",0,"movie",50);
  650.       var number_steps = Math.round(Math.sqrt(Math.pow(Math.abs(mc_anim._x - mc_to._x),2) + Math.pow(Math.abs(mc_anim._y - mc_to._y),2)) / speed * acsel);
  651.       var i = 1;
  652.       while(number_steps >= i)
  653.       {
  654.          if(scale)
  655.          {
  656.             this.put(mc_anim,"AnimToPlace",0,mc_anim._xscale,mc_to._xscale,number_steps + 1 - to_end,i,"_xscale");
  657.             this.put(mc_anim,"AnimToPlace",0,mc_anim._yscale,mc_to._yscale,number_steps + 1 - to_end,i,"_yscale");
  658.          }
  659.          this.put(mc_anim,"AnimToPlace",0,mc_anim._x,mc_to._x,number_steps + 1 - to_end,i,"_x");
  660.          this.put(mc_anim,"AnimToPlace","1",mc_anim._y,mc_to._y,number_steps + 1 - to_end,i,"_y");
  661.          i++;
  662.       }
  663.       this.put(mc_anim,"swapDepths",0,_root.anim_depth);
  664.    };
  665.    conv.bookmark_add = function()
  666.    {
  667.       this.aConveyor.push("#bookmark#");
  668.       this.bookmark = this.bookmark + 1;
  669.    };
  670.    conv.bookmark_remove = function()
  671.    {
  672.       if(0 >= this.bookmark)
  673.       {
  674.          return undefined;
  675.       }
  676.       this.bookmark--;
  677.       while(this.aConveyor[this.aConveyor.length - 1] != "#bookmark#")
  678.       {
  679.          this.aConveyor.unshift(this.aConveyor.pop());
  680.       }
  681.       this.aConveyor.pop();
  682.    };
  683.    conv_engine = function()
  684.    {
  685.       _root.conv.engine();
  686.    };
  687.    setTimeOut = function(funcLink, timeOut, inOut)
  688.    {
  689.       var McTimeOut = MySTM;
  690.       if(inOut)
  691.       {
  692.          if(funcLink[0] != null)
  693.          {
  694.             var tA = funcLink[1];
  695.             funcLink[0](tA[0],tA[1],tA[2],tA[3],tA[4],tA[5],tA[6],tA[7],tA[8],tA[9]);
  696.          }
  697.          else
  698.          {
  699.             funcLink();
  700.          }
  701.       }
  702.       else
  703.       {
  704.          McTimeOut.n = McTimeOut.n + 1;
  705.          McTimeOut.STM.duplicateMovieClip("STM" + McTimeOut.n,McTimeOut.n);
  706.          var newTarg = McTimeOut["STM" + McTimeOut.n];
  707.          if(typeof timeOut == "string")
  708.          {
  709.             timeOut = Number(timeOut);
  710.             newTarg.frame = true;
  711.          }
  712.          else
  713.          {
  714.             newTarg.time = getTimer();
  715.          }
  716.          newTarg.funcString = funcLink;
  717.          newTarg.timeOut = timeOut;
  718.       }
  719.    };
  720.    conv = null;
  721.    delete conv;
  722.    conv = new Conveyor_Constructor();
  723.    var my = {};
  724.    my.floor = function()
  725.    {
  726.       var tmpStNum = new String(arguments[0]);
  727.       return Math.floor(Number(tmpStNum));
  728.    };
  729.    my.GlobalToLocal = function(toObj, fromObj)
  730.    {
  731.       var GlobalObj = new Object();
  732.       GlobalObj.x = fromObj._x;
  733.       GlobalObj.y = fromObj._y;
  734.       toObj.globalToLocal(GlobalObj);
  735.       return new Array(GlobalObj.x,GlobalObj.y);
  736.    };
  737.    my.dZerro = function()
  738.    {
  739.       if(arguments[0] == 0)
  740.       {
  741.          return "0.00";
  742.       }
  743.       var dStr = new String(this.floor(arguments[0] * 100));
  744.       var one = dStr.substr(0,dStr.length - 2);
  745.       if(one == "")
  746.       {
  747.          one = "0";
  748.       }
  749.       var two = dStr.substr(-2);
  750.       if(two == "0")
  751.       {
  752.          two = "00";
  753.       }
  754.       return one + "." + two;
  755.    };
  756. }
  757. hello = "Hello Source Viewers! ;) Code Created by 3WGRAPHICS.com";
  758. delete hello;
  759. game_pr = GamePrams.prototype;
  760. game_pr.crBalance = function()
  761. {
  762.    _root.balance = "$ " + _root.my.dZerro(this.userBalance);
  763. };
  764. game_pr.random_numbers = function()
  765. {
  766.    return [].concat(this.ideal_numbers).random().splice(0,20);
  767. };
  768. game_pr.choice_number = function(number_name)
  769. {
  770.    number_name = Number(number_name);
  771.    var mc = _root.numbers["n_" + number_name];
  772.    if(this.numbers[number_name])
  773.    {
  774.       delete this.numbers[number_name];
  775.       this.numbers_length--;
  776.       mc.copyColor(_root.non_selected);
  777.    }
  778.    else
  779.    {
  780.       if(this.numbers_length >= this.max_length)
  781.       {
  782.          return undefined;
  783.       }
  784.       this.numbers[number_name] = true;
  785.       this.numbers_length = this.numbers_length + 1;
  786.       mc.copyColor(_root.selected);
  787.    }
  788.    this.setButtons();
  789. };
  790. game_pr.choice_bet = function(bet)
  791. {
  792.    this.curBet = bet;
  793.    this.setButtons();
  794. };
  795. game_pr.display_prize_table = function()
  796. {
  797.    var ob = this.prize_table[this.numbers_length];
  798.    var n = this.numbers_length;
  799.    var mc = _root.display_left;
  800.    mc.numbers = "";
  801.    mc.prize = "";
  802.    while(ob[n] != null)
  803.    {
  804.       mc.numbers += n + "\r";
  805.       mc.prize += "$" + ob[n] * this.curBet + "\r";
  806.       n--;
  807.    }
  808. };
  809. game_pr.setButtons = function()
  810. {
  811.    _root.b_1.gotoAndStop(1);
  812.    _root.b_5.gotoAndStop(1);
  813.    _root.b_10.gotoAndStop(1);
  814.    _root["b_" + this.curBet].gotoAndStop(2);
  815.    var mc = _root.play_buttons;
  816.    if(this.numbers_length < 3)
  817.    {
  818.       mc.p_1.gotoAndStop(2);
  819.       mc.p_5.gotoAndStop(2);
  820.       mc.p_10.gotoAndStop(2);
  821.    }
  822.    else
  823.    {
  824.       if(this.userBalance >= this.curBet)
  825.       {
  826.          mc.p_1.gotoAndStop(1);
  827.       }
  828.       if(this.userBalance >= this.curBet * 5)
  829.       {
  830.          mc.p_5.gotoAndStop(1);
  831.       }
  832.       if(this.userBalance >= this.curBet * 10)
  833.       {
  834.          mc.p_10.gotoAndStop(1);
  835.       }
  836.    }
  837.    this.display();
  838.    this.display_prize_table();
  839. };
  840. game_pr.play = function(rounds)
  841. {
  842.    this.lock();
  843.    this.rounds = rounds;
  844.    this.userBalance -= this.rounds * this.curBet;
  845.    this.crBalance();
  846.    this.display();
  847.    _root.conv.put(this,"play_final","1");
  848. };
  849. game_pr.play_final = function(complette, result)
  850. {
  851.    this.numbers_rounds = [];
  852.    if(_level5)
  853.    {
  854.       if(!complette)
  855.       {
  856.          var numbers_post = [];
  857.          for(var v in "this:numbers")
  858.          {
  859.             if(this.numbers[v] == true)
  860.             {
  861.                numbers_post.push(v);
  862.             }
  863.          }
  864.          _level5.XML_POST_round(numbers_post,this.rounds,this.curBet);
  865.          return undefined;
  866.       }
  867.       this.numbers_rounds = result;
  868.    }
  869.    this.win_bet = 0;
  870.    this.numbers_result = [];
  871.    var i = 0;
  872.    while(i < this.rounds)
  873.    {
  874.       _root.conv.put(this,"round_check",0,this.numbers_rounds[i] || 0,i + 1);
  875.       i++;
  876.    }
  877.    if(_level5)
  878.    {
  879.       _root.conv.put(function(bal)
  880.       {
  881.          _root.Game.userBalance = Game.userBalance_from_server;
  882.          _root.Game.crBalance();
  883.       }
  884.       ,0);
  885.    }
  886.    this.bet = 0;
  887.    _root.conv.put(this,"unlock",0);
  888. };
  889. game_pr.round_check = function(numbers_array, round)
  890. {
  891.    _root.conv.bookmark_add();
  892.    _root.conv.put(this,"remove_round",0);
  893.    var num;
  894.    var mc;
  895.    var win_mc = [];
  896.    if(numbers_array == 0)
  897.    {
  898.       numbers_array = this.random_numbers();
  899.    }
  900.    this.numbers_result[round - 1] = 0;
  901.    var j = 0;
  902.    while(j < numbers_array.length)
  903.    {
  904.       num = numbers_array[j];
  905.       mc = _root.numbers["n_" + num];
  906.       if(this.numbers[num] != null)
  907.       {
  908.          _root.conv.put(_root,"newSound",100,"movie",100);
  909.          _root.conv.put(this,"win_mark",0,num);
  910.          _root.conv.put(_root,"newSound",200,"movie",100);
  911.          win_mc.push(mc);
  912.          this.numbers_result[round - 1]++;
  913.       }
  914.       else
  915.       {
  916.          _root.conv.put(_root,"newSound",0,"movie",100);
  917.          _root.conv.put(this,"loose_mark",200,num);
  918.       }
  919.       j++;
  920.    }
  921.    _root.conv.put(function(rounds, result)
  922.    {
  923.       _root.display_right.rounds += rounds + "\r";
  924.       _root.display_right.result += result + "\r";
  925.    }
  926.    ,"2",round,this.numbers_result[round - 1]);
  927.    var prize_result = this.prize_table[this.numbers_length][this.numbers_result[round - 1]];
  928.    if(prize_result != null)
  929.    {
  930.       _root.conv.put(_root,"newSound",0,"win");
  931.       this.win_bet += prize_result * this.curBet;
  932.       _root.conv.put(this,"display",0,this.win_bet,this.userBalance + prize_result * this.curBet);
  933.       _root.conv.put(_root.display_right["win_" + round],"show","2");
  934.       var c = 0;
  935.       while(c < 5)
  936.       {
  937.          var j = 0;
  938.          while(win_mc.length >= j)
  939.          {
  940.             _root.conv.put(win_mc[j],"copyColor",0,_root.non_selected);
  941.             _root.conv.put(win_mc[j - 1],"copyColor","4",_root.selected);
  942.             j++;
  943.          }
  944.          c++;
  945.       }
  946.    }
  947.    _root.conv.bookmark_remove();
  948. };
  949. game_pr.win_mark = function(num)
  950. {
  951.    _root.attachMovie("win_mark","win_mark_" + num,1000 + num).align(_root.numbers["n_" + num]);
  952. };
  953. game_pr.loose_mark = function(num)
  954. {
  955.    _root.attachMovie("loose_mark","loose_mark_" + num,1000 + num).align(_root.numbers["n_" + num]);
  956. };
  957. game_pr.remove_round = function()
  958. {
  959.    var i = 1;
  960.    while(80 >= i)
  961.    {
  962.       _root["win_mark_" + i].removeMovieClip();
  963.       _root["loose_mark_" + i].removeMovieClip();
  964.       i++;
  965.    }
  966. };
  967. game_pr.lock = function()
  968. {
  969.    this.locked = true;
  970.    var i = 1;
  971.    while(80 >= i)
  972.    {
  973.       _root.numbers["n_" + i].button.hide();
  974.       i++;
  975.    }
  976.    _root.b_1.gotoAndStop(3);
  977.    _root.b_5.gotoAndStop(3);
  978.    _root.b_10.gotoAndStop(3);
  979.    _root["b_" + this.curBet].gotoAndStop(2);
  980.    var mc = _root.play_buttons;
  981.    mc.p_1.gotoAndStop(2);
  982.    mc.p_5.gotoAndStop(2);
  983.    mc.p_10.gotoAndStop(2);
  984. };
  985. game_pr.unlock = function()
  986. {
  987.    this.locked = false;
  988.    _root.play_buttons.gotoAndStop(2);
  989. };
  990. game_pr.new_game = function()
  991. {
  992.    _root.play_buttons.gotoAndStop(1);
  993.    var mc;
  994.    var i = 1;
  995.    while(80 >= i)
  996.    {
  997.       mc = _root.numbers["n_" + i];
  998.       mc.button.show();
  999.       mc.copyColor(_root.non_selected);
  1000.       i++;
  1001.    }
  1002.    _root.display_right.rounds = "";
  1003.    _root.display_right.result = "";
  1004.    var i = 1;
  1005.    while(10 >= i)
  1006.    {
  1007.       _root.display_right["win_" + i].hide();
  1008.       i++;
  1009.    }
  1010.    this.numbers_length = 0;
  1011.    this.win_bet = 0;
  1012.    this.numbers = [];
  1013.    this.rounds = 0;
  1014.    this.remove_round();
  1015.    this.setButtons();
  1016. };
  1017. game_pr.display = function(win_bet, balance)
  1018. {
  1019.    _root.display = "";
  1020.    if(0 < this.numbers_length)
  1021.    {
  1022.       _root.display = "Numbers " + this.numbers_length + "\r";
  1023.    }
  1024.    if(this.locked)
  1025.    {
  1026.       _root.display += "Total bet $" + this.curBet * this.rounds + "\r";
  1027.    }
  1028.    if(0 < win_bet)
  1029.    {
  1030.       _root.display += "Player wins $" + win_bet;
  1031.       this.userBalance = balance;
  1032.       this.crBalance();
  1033.    }
  1034. };
  1035. game_pr.sounds = function()
  1036. {
  1037.    if(!this.voiceON)
  1038.    {
  1039.       return undefined;
  1040.    }
  1041. };
  1042. Game = new GamePrams();
  1043. startGame();
  1044. var chDepth = 0;
  1045. game_pr = null;
  1046. delete game_pr;
  1047. test_server();
  1048. _focusrect = false;
  1049.